Skip to content

[5.4] POST com_contact form with webservices and custom reply enabled#47819

Merged
muhme merged 6 commits into
joomla:5.4-devfrom
alikon:patch-7
Jun 11, 2026
Merged

[5.4] POST com_contact form with webservices and custom reply enabled#47819
muhme merged 6 commits into
joomla:5.4-devfrom
alikon:patch-7

Conversation

@alikon

@alikon alikon commented May 24, 2026

Copy link
Copy Markdown
Contributor

Pull Request resolves #44927 alternative to #45136

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Refactor email sending logic in ContactController when no custom reply enabled

Testing Instructions

Set custom_reply parameter to true in com_contact
Try to send a message using webservices
POST https://yoursite/api/index.php/v1/contacts/form/{contact_id} with this example payload

{
    "contact_email": "email@example.org",
    "contact_message": "some text",
    "contact_name": "name",
    "contact_subject": "subject"
}

Actual result BEFORE applying this Pull Request

Exception

Expected result AFTER applying this Pull Request

no Exception

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@alikon
alikon marked this pull request as ready for review May 24, 2026 09:20
Comment thread api/components/com_contact/src/Controller/ContactController.php Outdated
Comment thread api/components/com_contact/src/Controller/ContactController.php Outdated
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@ThomasFinnern

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 555e138

The test were made by a PHP script calling curl function similar to manual.joomla.org doc.

I debugged with phpstorm and found following

  1. Parameter show_email_form
    @alikon: On first tests i got an exception on ContactController.php line 122. Which did not change with the patch.
    Surprisingly when i changed parameter 'contact->form->Contact Form' from 'Use Global (Show)' to 'show' this

  2. Patch results
    I do know i changed a lot of the settings before the above find. This is my actual result:
    Without patch: "Error sending message"
    With patch: ""

:


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47819.

@exlemor

exlemor commented May 29, 2026

Copy link
Copy Markdown

@alikon with the Testing Instructions above, I get the same BEFORE and AFTER, code": 500, "title": "Internal server error". What am I doing wrong? :(

@alikon

alikon commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@exlemor my previous test instruction was very bad 😄
just enable the Custom Reply without pr you got execption
with pr no more

@exlemor

exlemor commented Jun 1, 2026

Copy link
Copy Markdown

Hi @alikon, I assume you are being funny ;) but that's what I understood the Testing Instructions to be but I get the same 500 internal server error with or without the Patch ;(

@QuyTon

QuyTon commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 555e138


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47819.

@QuyTon

QuyTon commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47819.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 9, 2026
@muhme

muhme commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

✅ Final test before merge with JBT. In a new nightly build installation:

  • First see frontend to understand the functionality
    • Set Contacts > Form > Custom Reply: No
    • Created one contact, linked to user to ci-admin
      • ⚠️ set 'Contact Form: Show' for this contact, see 47942
    • Created menu item 'Single contact' with this contact
    • Was able to send email from site contact form
    • Was able to send email from API
  • See the issue error
    • Set Contacts > Form > Custom Reply: Yes
    • Sending email from site contact form is no more possible
      • Silent, w/o any notice, the formular is reopened with empty fields, no email sent from Joomla 👉 email have to be send by 3rd party plugin (not tested!)
    • Sending email with API fails with 400 'Error sending message'
  • Applied the PR with Patch Tester
    • ✅ Trying to send email with API is 200 OK, no email sent from Joomla 👉 email have to be send by 3rd party plugin (not tested!)

@muhme
muhme merged commit d1118be into joomla:5.4-dev Jun 11, 2026
136 of 137 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 11, 2026
@muhme

muhme commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thank you very much @alikon for your contribution. Thanks to @QuyTon and @richard67 for review and support. Thanks to @exlemor, @ThomasFinnern and @QuyTon for testing.

@QuyTon QuyTon added this to the Joomla! 5.4.7 milestone Jun 11, 2026
@alikon
alikon deleted the patch-7 branch June 12, 2026 06:27
HLeithner added a commit that referenced this pull request Jun 22, 2026
* [5.4] Reorder and delete duplicate Text::script() calls for joomlaupdate (#47917)


---------

Signed-off-by: BrianTeeman <brian@teeman.net>

* [5.4] Fix doc block for input type (#47931)

* [5.4] POST com_contact form with webservices and custom reply enabled (#47819)


---------

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Quy Ton <quy@nomonkeybiz.com>

* [5.4] Translation Update (#47949)

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Use PAT for commit

* Update create-translation-pull-request-v5.yml

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Delete installation/language/en-US/joomla.cli.ini

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

---------

Co-authored-by: Harald Leithner <leithner@itronic.at>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Heiko Lübbe <github@heikol.de>
Co-authored-by: Stefan Wendhausen <stefan.wendhausen@tec-promotion.de>

* [5.4] Always use a new installer instance on discover install (#47964)

* [5.4] Fix potential issue with update multiple extensions (#47978)

* [5.4] Cookie authentication: load language file so log message is translated

* [5.4] Cookie authentication: fix username placeholder in failed-login log message (#47986)

---------

Signed-off-by: BrianTeeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
Co-authored-by: Nicola Galgano <optimus4joomla@gmail.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Quy Ton <quy@nomonkeybiz.com>
Co-authored-by: joomla-translation-bot <87496051+joomla-translation-bot@users.noreply.github.com>
Co-authored-by: Harald Leithner <leithner@itronic.at>
Co-authored-by: Heiko Lübbe <github@heikol.de>
Co-authored-by: Tuan Pham Ngoc <github@joomdonation.com>
tecpromotion added a commit that referenced this pull request Jun 25, 2026
* [5.4] Reorder and delete duplicate Text::script() calls for joomlaupdate (#47917)


---------

Signed-off-by: BrianTeeman <brian@teeman.net>

* [6.1] Fix Accessiblemedia subform values for non-image media types

* [5.4] Fix doc block for input type (#47931)

* [5.4] POST com_contact form with webservices and custom reply enabled (#47819)


---------

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Quy Ton <quy@nomonkeybiz.com>

* [5.4] Translation Update (#47949)

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Use PAT for commit

* Update create-translation-pull-request-v5.yml

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Delete installation/language/en-US/joomla.cli.ini

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

---------

Co-authored-by: Harald Leithner <leithner@itronic.at>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Heiko Lübbe <github@heikol.de>
Co-authored-by: Stefan Wendhausen <stefan.wendhausen@tec-promotion.de>

* [5.4] Always use a new installer instance on discover install (#47964)

* [5.4] Fix potential issue with update multiple extensions (#47978)

* [5.4] Cookie authentication: load language file so log message is translated

* [5.4] Cookie authentication: fix username placeholder in failed-login log message (#47986)

* Add deleted files from PR #47876 (#47892)

* [6.2] Update deprecation target version to be inline with policy (#47983)

* Update deprecation target version to be inline with policy

* only minor

* [6.2] Fix Save as Copy for access levels by generating unique title (#47707)

* Fix for SaveAsCopy for access levels

* missed em

* [6.2] Uplift some doc block removal 6.0 versions to 7.0 (#47982)

* Uplift some doc block removal 6.0 versions to 7.0

* 5

* baseline

* Update layouts/joomla/form/field/radiobasic.php

Co-authored-by: Martin Carl Kopp <6154099+MacJoom@users.noreply.github.com>

* Update libraries/src/Form/Field/RadiobasicField.php

Co-authored-by: Martin Carl Kopp <6154099+MacJoom@users.noreply.github.com>

* [5.4] Translation Update (#48000)

* [5.4] Use the correct function to get the message from an exception (#47972)

* [6.2] Fix Category Feed Intro Text With Include In Feed (#47788)

* [6.2] Fix Featured Article Feed Intro Text With Include In Feed (#47787)

* [6.1] Translation Update (#48001)

* Update create-translation-pull-request-v6.yml

* Update create-translation-pull-request-v6.yml

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Use PAT for translation bot

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* fix build error

https://github.com/joomla-translation-bot/joomla-cms/actions/runs/20963499191/job/60247089852

* Language update

* Update joomla.cli.ini

* Delete installation/language/en-US/joomla.cli.ini

* add en-us joomla.cli.ini

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* [6.1] update translation-pull-request workflow

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

* Language update

---------

Co-authored-by: Gary Barclay <1881642+Bodge-IT@users.noreply.github.com>
Co-authored-by: Stefan Wendhausen <stefan.wendhausen@tec-promotion.de>
Co-authored-by: Phil Walton <phil@softforge.co.uk>

* [6.1] update css-versioning.mjs (#47996)

* [6.1] Update Tinymce and languagse (#47994)

Co-authored-by: Harald Leithner <leithner@itronic.at>

* npm audit fix (#48006)

* [6.2] composer update (#48007)

* Joomla! 6.2.0 Alpha 2

* Revert to dev

Signed-off-by: Martin Kopp <kopp05@infotech.ch>

---------

Signed-off-by: BrianTeeman <brian@teeman.net>
Signed-off-by: Martin Kopp <kopp05@infotech.ch>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Stefan Wendhausen <stefan.wendhausen@tec-promotion.de>
Co-authored-by: Nicola Galgano <optimus4joomla@gmail.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Quy Ton <quy@nomonkeybiz.com>
Co-authored-by: joomla-translation-bot <87496051+joomla-translation-bot@users.noreply.github.com>
Co-authored-by: Harald Leithner <leithner@itronic.at>
Co-authored-by: Heiko Lübbe <github@heikol.de>
Co-authored-by: Tuan Pham Ngoc <github@joomdonation.com>
Co-authored-by: Krishna Gandhi <krishnagandhi0911@gmail.com>
Co-authored-by: Martin Carl Kopp <6154099+MacJoom@users.noreply.github.com>
Co-authored-by: Abdelrahman Nabil <163023550+CSGoat0@users.noreply.github.com>
Co-authored-by: Gary Barclay <1881642+Bodge-IT@users.noreply.github.com>
Co-authored-by: Phil Walton <phil@softforge.co.uk>
Co-authored-by: Harald Leithner <joomla@itronic.at>
Co-authored-by: Martin Kopp <kopp05@infotech.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sending a message from com_contact using API with custom_reply set to true will most likely result in an Exception

7 participants